using System;
using EPiServer.Common;
using EPiServer.Common.Queries;
using EPiServer.Common.Security;
using EPiServer.Community.Contest;
using EPiServer.Community.Contest.Queries;

namespace EPiAbstractions.Community.Contest
{
    public interface IContestHandlerFacade
    {
        EPiServer.Community.Contest.Contest GetContest(Int32 id);

        EPiServer.Community.Contest.Contest AddContest(EPiServer.Community.Contest.Contest contest);

        void RemoveContest(EPiServer.Community.Contest.Contest contest);

        void UpdateContest(EPiServer.Community.Contest.Contest contest);

        ContestCollection GetContests(Int32 page, Int32 pageSize, ContestSortOrder[] sortOrder);

        ContestCollection GetContests(Int32 page, Int32 pageSize, out Int32 totalItems, ContestSortOrder[] sortOrder);

        ContestCollection GetContests(Int32 page, Int32 pageSize, SiteCollection sites, ContestSortOrder[] sortOrder);

        ContestCollection GetContests(Int32 page, Int32 pageSize, SiteCollection sites, out Int32 totalItems, ContestSortOrder[] sortOrder);

        ContestCollection GetContests(Int32 page, Int32 pageSize, SiteCollection sites, NullValueAction siteNullAction,
                                      ContestSortOrder[] sortOrder);

        ContestCollection GetContests(Int32 page, Int32 pageSize, SiteCollection sites, NullValueAction siteNullAction, out Int32 totalItems,
                                      ContestSortOrder[] sortOrder);

        Question GetQuestion(Int32 id);

        SubmissionCollection GetSubmissions(EPiServer.Community.Contest.Contest contest, Int32 page, Int32 pageSize);

        SubmissionCollection GetSubmissions(EPiServer.Community.Contest.Contest contest, Int32 page, Int32 pageSize, out Int32 totalItems);

        SubmissionCollection GetSubmissions(EPiServer.Community.Contest.Contest contest, Int32 page, Int32 pageSize,
                                            SubmissionSortOrder[] sortOrder);

        SubmissionCollection GetSubmissions(EPiServer.Community.Contest.Contest contest, Int32 page, Int32 pageSize, out Int32 totalItems,
                                            SubmissionSortOrder[] sortOrder);

        Submission AddSubmission(Submission submission);

        Submission GetSubmission(Int32 id);

        Submission GetSubmission(IUser user, EPiServer.Community.Contest.Contest contest);

        void RemoveSubmission(Submission submission);

        Alternative GetAlternative(Int32 id);

        Answer GetAnswer(Int32 id);

        event EPiServerCommonEventHandler ContestAdded;

        event EPiServerCommonEventHandler ContestUpdated;

        event EPiServerCommonEventHandler ContestRemoved;

        event EPiServerCommonEventHandler QuestionAdded;

        event EPiServerCommonEventHandler QuestionUpdated;

        event EPiServerCommonEventHandler QuestionRemoved;

        event EPiServerCommonEventHandler AlternativeAdded;

        event EPiServerCommonEventHandler AlternativeUpdated;

        event EPiServerCommonEventHandler AlternativeRemoved;

        event EPiServerCommonEventHandler AnswerAdded;

        event EPiServerCommonEventHandler SubmissionAdded;

        event EPiServerCommonEventHandler SubmissionRemoved;

        event EPiServerCommonEventHandler WinnerAdded;

        event EPiServerCommonEventHandler WinnerRemoved;

        ContestCollection GetQueryResult(ContestQuery query);

        ContestCollection GetQueryResult(ContestQuery query, Int32 page, Int32 pageSize);

        ContestCollection GetQueryResult(ContestQuery query, Int32 page, Int32 pageSize, out Int32 totalItems);

        AnswerCollection GetQueryResult(AnswerQuery query);

        AnswerCollection GetQueryResult(AnswerQuery query, Int32 page, Int32 pageSize);

        AnswerCollection GetQueryResult(AnswerQuery query, Int32 page, Int32 pageSize, out Int32 totalItems);

        AnswerCollection GetQueryResult(TextAnswerQuery query);

        AnswerCollection GetQueryResult(TextAnswerQuery query, Int32 page, Int32 pageSize);

        AnswerCollection GetQueryResult(TextAnswerQuery query, Int32 page, Int32 pageSize, out Int32 totalItems);

        AnswerCollection GetQueryResult(SingleAlternativeAnswerQuery query);

        AnswerCollection GetQueryResult(SingleAlternativeAnswerQuery query, Int32 page, Int32 pageSize);

        AnswerCollection GetQueryResult(SingleAlternativeAnswerQuery query, Int32 page, Int32 pageSize, out Int32 totalItems);

        AnswerCollection GetQueryResult(MultipleAlternativeAnswerQuery query);

        AnswerCollection GetQueryResult(MultipleAlternativeAnswerQuery query, Int32 page, Int32 pageSize);

        AnswerCollection GetQueryResult(MultipleAlternativeAnswerQuery query, Int32 page, Int32 pageSize, out Int32 totalItems);

        QuestionCollection GetQueryResult(QuestionQuery query);

        QuestionCollection GetQueryResult(QuestionQuery query, Int32 page, Int32 pageSize);

        QuestionCollection GetQueryResult(QuestionQuery query, Int32 page, Int32 pageSize, out Int32 totalItems);

        SubmissionCollection GetQueryResult(SubmissionQuery query);

        SubmissionCollection GetQueryResult(SubmissionQuery query, Int32 page, Int32 pageSize);

        SubmissionCollection GetQueryResult(SubmissionQuery query, Int32 page, Int32 pageSize, out Int32 totalItems);
    }
}